/**
 * Copyright &copy; 2012-2016 <a href="https://github.com/thinkgem/jeesite">JeeSite</a> All rights reserved.
 */
package com.thinkgem.jeesite.modules.cms.web.front;

import com.thinkgem.jeesite.common.web.BaseController;
import com.thinkgem.jeesite.modules.source.entity.program.EleSourceProgram;
import com.thinkgem.jeesite.modules.source.service.program.EleSourceProgramService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.RequestMapping;

import java.util.List;

/**
 * 网站Controller
 * @author ThinkGem
 * @version 2013-5-29
 */
@Controller
@RequestMapping(value = "${frontPath}")
public class FrontController extends BaseController{
	
	@Autowired
	private EleSourceProgramService eleSourceProgramService;

	/**
	 * app软件下载
	 */
	@RequestMapping
	public String index(String appType,String remarks, Model model){
		List<EleSourceProgram> application = eleSourceProgramService.findNewVersionApp(appType,remarks);
		model.addAttribute("application", application);
		return "modules/cms/front/themes/frontIndex";
	}

    /**
     * app软件下载
     */
    @RequestMapping(value = "list")
    public String appList(Model model){
        List<EleSourceProgram> applications = eleSourceProgramService.findList(null);
        model.addAttribute("applications", applications);
        return "modules/equipment/";
    }
}
